-
Notifications
You must be signed in to change notification settings - Fork 17
fix: merge namespaces when collecting results #896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: merge namespaces when collecting results #896
Conversation
An automated preview of the documentation is available at https://896.mrdocs.prtest2.cppalliance.org/index.html |
This looks very weird to me.
If by "visible" you mean copied into
Not really. The second, third, ... is supposed to be merged with
|
Then the implementation of I think the intention was to call the most specific visit(**it, [&]<typename T>(T& target) {
auto *source = dynamic_cast<T*>(other.get());
MRDOCS_ASSERT(source);
merge(target, std::move(*source));
}); ^ this might be the intention here. |
Exactly! |
4730ae7
to
13b1fcb
Compare
An automated preview of the documentation is available at https://896.mrdocs.prtest2.cppalliance.org/index.html |
Now, this is good to go, right? I'll merge this one first because whatever I merge, the other needs to be rebased, and this one is more important. |
Thank you! |
I'm not 100% sure if this is the correct approach. I would guess that something like this already happens somewhere, but I couldn't find anything.
When using multiple sources (→ multiple extraction jobs), then only the first one will be "visible", because its global namespace/global symbol will be the only one that gets merged with
info_.merge(info)
. All other global namespaces will be discarded, because there's already one present. Their members will still be in the corpus, but there's no path from the global symbol to them.Because of ODR, only namespaces have to be merged.